<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>鼓励金转账</title>
		<script src="__INDEX__/js/mui.min.js"></script>
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/mall.css" />
		<link rel="stylesheet" href="__INDEX__/css/wallet.css" />
	</head>
<style>
	.mask_con .top .wz {
    padding-left: 5px;
    font-size: 16px;
    font-weight: bold;
    width: unset;
}
</style>
	<body>
		<header class="mui-bar mui-bar-nav glj_bar_nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">鼓励金转账</h1>
		</header>
		<div class="mui-content">
			<div class="glj_top">
				<p class="glj_zsnum">{$info_user.score}</p>
				<p>鼓励金余额</p>
			</div>
			<div class="glj_zzitem">
				<p class="glj_zzbt">转账金额<span style="color: red;font-size: 14px;">(鼓励金转账扣除5%手续费1000鼓励金到账950)</span></p>
				<p class="glj_zznum">
					<label>¥</label>
					<input type="text" id="much" placeholder="0.00">
				</p>
			</div>
			<div class="glj_zzitem">
				<p class="glj_zzbt">收款人账号</p>
				<p class="glj_zznam"><input type="text" id="no" placeholder="请输入收款人手机号码"></p>
			</div>
			<button class="tixian_btn">确认</button>
		</div>
		<!-- 支付密码 start-->
		<div class="mask" id='pay_by_score'>
			<div class="mask_con">
				<div class="top">
					<span class="del"><button type="button"  onclick="location.reload()">X</button></span>
					<div style="text-align: center;">
						<span class="tx">
							{if count($info_user['logo'])>2}
								<img src="{$info_user['logo']}">
							{else}
								<img src="__INDEX__/images/bgtu.jpg">
							{/if}
						</span>
						<span class="wz" >请输入操作密码</span>
					</div>
					<span class="wz" style="width: 45%;"><a href="update_pwd2.html" style="float: right;font-size: 14px;color: red;margin-right: 15px;">忘记密码</a></span>
				</div>
				<div class="xfk_btn" id='is_pay_pwd' style="display: none;"><button type="button">设置支付密码</button></div>
				<div class="pwd-box" id='pay_pwd' style="none">
					<input type="tel" maxlength="6" class="pwd-input" id="pwd-input">
					<div class="fake-box">
						<input type="password" readonly="">
						<input type="password" readonly="">
						<input type="password" readonly="">
						<input type="password" readonly="">
						<input type="password" readonly="">
						<input type="password" readonly="">
					</div>
				</div>
			</div>
		</div>
		<!-- 支付密码 end-->
	</body>
	{include file="public/footer" /}
	<script src="__PUBLIC__/static/js/mui.min.js"></script>
	<script src="__PUBLIC__/static/js/zepto-1.1.6.min.js"></script>
	<script>
		$(".tixian_btn").click(function() {
				var much = $("#much").val();
				var no = $("#no").val();
				if(isNaN(much) || much <= 0) {
					layer.msg("请输入正确转账金额");
					return;
				}
				if(no == '') {
					layer.msg("请输入正确的收款人手机号码");
					return;
				}
			$('#pay_by_score').show();
			var $input = $(".fake-box input");  
		    $("#pwd-input").on("input", function() {  
		        var pwd = $(this).val().trim();  
		        for (var i = 0, len = pwd.length; i < len; i++) {  
		            $input.eq("" + i + "").val(pwd[i]);  
		        }  
		        $input.each(function() {  
		            var index = $(this).index();  
		            if (index >= len) {  
		                $(this).val("");  
		            }
		        });
		        
				if (len == 6) { 
					$.ajax({
						url: "{:url('member/glj_zz')}",
						type: 'post',
						data: {
							much	: much,
							no		: no,
							pwd		: pwd
						},
						success: function(data) {
							layer.msg(data.msg, {
								icon: 5,
								time: 1000
							}, function() {
								window.location.href = "{:url('member/glj')}";
							});
						}
					})
				}
		    });
		})
	</script>

</html>